var api = require('../../utils/api.js');
var app = getApp();


Page({

    /**
     * 页面的初始数据
     */
    data: {
        dateb:'',
        datea:'',
        lists:'',
        info:''
    },

    /**
     * 生命周期函数--监听页面加载 getdata
     */
    onLoad(options) {
        var that=this;
        api.post({
            url: 'dates/getdata',
            data: {},
            success: data => {
                that.setData({
                    startime:data.data
                })
            }
        })
    },
    onShow(){
        this.getalllists();
    },

    getalllists(){
        var that=this;
        var   datea=this.data.datea;
        var   dateb=this.data.dateb;
         
        
        api.post({
            url: 'dates/getalldatas',
            data: {strtime:datea,endtime:dateb},
            success: data => {
                that.setData({
                    infos:data.data
                })
            }
        })
    },

    bindDateChangea(ret){
        this.setData({
            datea:ret.detail.value
        })

        this.getalllists();

    },
    bindDateChangeb(ret){
        this.setData({
            dateb:ret.detail.value
        })

        this.getalllists();

    },
    clearall(){

        this.setData({
            dateb:'',
            datea:'',
            lists:'',
            info:''
        })  

        this.getalllists();

    }

})